package com.ggjj.filter_interceptor_controlleradvice_aop.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.InitBinder;

/**
 * @author gengjian
 * @date 2025/02/14 21:37:28
 */
@ControllerAdvice
@Slf4j
public class DemoControllerAdvice {
    @InitBinder
    public void init(){
        log.info("ControllerAdvice init 进入");
    }
    @ExceptionHandler(Exception.class)
    public String handleException(Exception e){
        log.info("ControllerAdvice handleException 进入");
        return "error";
    }
}
